import axios from 'axios'

let error = console.error

const api = '/account/name'

export function listByName (name, cb, fcb = () => error('findAll')) {
  axios.get(api, {params: {name}}).then(res => {
    let data = res.data
    cb(data)
  }).catch(error => {
    fcb(error)
  })
}
